<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>罗伦士车型配置选择</title>
    <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script> -->
    <!-- 引入 Vue.js -->
    <script src="../../assets/js/vue.js"></script>
    <script src="../../assets/js/auth.js"></script>
    <style>
        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 1000px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f5f5f5;
        }
        h1 {
            text-align: center;
            color: #2c3e50;
            margin-bottom: 30px;
        }
        .platform-selector {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        .platform-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 15px;
            color: #2c3e50;
        }
        .select-group {
            display: flex;
            gap: 20px;
            margin-bottom: 15px;
        }
        .select-wrapper {
            flex: 1;
        }
        select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 15px;
            background-color: #fff;
        }
        select:disabled {
            background-color: #f5f5f5;
            color: #999;
        }
        .fixed-specs {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        .specs-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 15px;
            color: #2c3e50;
        }
        .specs-table {
            width: 100%;
            border-collapse: collapse;
        }
        .specs-table th, .specs-table td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid #eee;
        }
        .specs-table th {
            background-color: #f9f9f9;
            font-weight: bold;
            color: #2c3e50;
        }
        .specs-table tr:hover {
            background-color: #f5f5f5;
        }
        .platform-info {
            margin-top: 10px;
            font-weight: bold;
            color: #2c3e50;
        }
        .main-category {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 30px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            opacity: 0.6;
            transition: opacity 0.3s;
        }
        .main-category.active {
            opacity: 1;
        }
        .main-category-title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 20px;
            color: #2c3e50;
            border-bottom: 2px solid #eee;
            padding-bottom: 10px;
        }
        .config-section {
            background-color: #f9f9f9;
            border-radius: 6px;
            padding: 15px;
            margin-bottom: 15px;
        }
        .section-title {
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 12px;
            color: #2c3e50;
        }
        .option-group {
            margin-bottom: 10px;
        }
        .option-label {
            display: block;
            position: relative;
            padding-left: 35px;
            margin-bottom: 10px;
            cursor: pointer;
            font-size: 15px;
            user-select: none;
        }
        .option-label input {
            position: absolute;
            opacity: 0;
            cursor: pointer;
        }
        .checkmark {
            position: absolute;
            top: 0;
            left: 0;
            height: 20px;
            width: 20px;
            background-color: #eee;
            border-radius: 50%;
        }
        .option-label:hover input ~ .checkmark {
            background-color: #ddd;
        }
        .option-label input:checked ~ .checkmark {
            background-color: #2196F3;
        }
        .checkmark:after {
            content: "";
            position: absolute;
            display: none;
        }
        .option-label input:checked ~ .checkmark:after {
            display: block;
        }
        .option-label .checkmark:after {
            top: 6px;
            left: 6px;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: white;
        }
        .custom-config {
            margin-top: 20px;
        }
        .custom-item {
            display: flex;
            margin-bottom: 10px;
            align-items: center;
        }
        .custom-input {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }
        .add-btn {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 8px 15px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            margin-left: 10px;
            display: flex;
            align-items: center;
        }
        .add-btn:hover {
            background-color: #45a049;
        }
        .remove-btn {
            background-color: #f44336;
            color: white;
            border: none;
            padding: 8px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            margin-left: 10px;
        }
        .remove-btn:hover {
            background-color: #d32f2f;
        }
        .summary {
            background-color: #2c3e50;
            color: white;
            padding: 20px;
            border-radius: 8px;
            margin-top: 30px;
        }
        .summary-title {
            font-size: 20px;
            margin-bottom: 15px;
            text-align: center;
        }
        .summary-category {
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        }
        .category-title {
            font-weight: bold;
            margin-bottom: 10px;
            font-size: 16px;
        }
        .summary-item {
            margin-bottom: 8px;
            padding-left: 15px;
        }
        .no-selection {
            color: #aaa;
            font-style: italic;
        }
        .custom-summary-item {
            display: flex;
            justify-content: space-between;
        }
        .custom-remove {
            color: #ff9999;
            cursor: pointer;
        }
        /* 添加下单按钮样式 */
        .order-button-container {
            text-align: center;
            margin-top: 30px;
            margin-bottom: 50px;
        }
        .order-button {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 15px 40px;
            border-radius: 8px;
            font-size: 18px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        .order-button:hover {
            background-color: #45a049;
        }
        .order-button:disabled {
            background-color: #cccccc;
            cursor: not-allowed;
        }
    </style>
</head>
<body>
    <div id="app">
        <h1>罗伦士车型配置选择</h1>
        
        <!-- 车平台和车型号选择 -->
        <div class="platform-selector">
            <div class="platform-title">选择车平台和车型</div>
            <div class="select-group">
                <div class="select-wrapper">
                    <label for="platform">车平台</label>
                    <select id="platform" v-model="selected.platform" @change="onPlatformChange">
                        <option value="">请选择车平台</option>
                        <option v-for="platform in platforms" :value="platform.id">{{ platform.name }}</option>
                    </select>
                </div>
                <div class="select-wrapper">
                    <label for="model">车型号</label>
                    <select id="model" v-model="selected.model" :disabled="!selected.platform" @change="onModelChange">
                        <option value="">请选择车型号</option>
                        <option v-for="model in filteredModels" :value="model.id">{{ model.name }}</option>
                    </select>
                </div>
            </div>
            <div class="platform-info" v-if="selected.model">
                当前选择: {{ selectedPlatformName }} - {{ selectedModelName }}
            </div>
        </div>
        
        <!-- 车辆固定配置表格 -->
        <div class="fixed-specs" v-if="selected.model">
            <div class="specs-title">车辆固定配置</div>
            <table class="specs-table">
                <thead>
                    <tr>
                        <th>配置项</th>
                        <th>规格参数</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>车身尺寸(长×宽×高)</td>
                        <td>{{ currentModelSpecs.dimensions }}</td>
                    </tr>
                    <tr>
                        <td>轴距</td>
                        <td>{{ currentModelSpecs.wheelbase }}</td>
                    </tr>
                    <tr>
                        <td>发动机型号</td>
                        <td>{{ currentModelSpecs.engine }}</td>
                    </tr>
                    <tr>
                        <td>排量</td>
                        <td>{{ currentModelSpecs.displacement }}</td>
                    </tr>
                    <tr>
                        <td>最大功率</td>
                        <td>{{ currentModelSpecs.maxPower }}</td>
                    </tr>
                    <tr>
                        <td>最大扭矩</td>
                        <td>{{ currentModelSpecs.maxTorque }}</td>
                    </tr>
                    <tr>
                        <td>变速箱</td>
                        <td>{{ currentModelSpecs.transmission }}</td>
                    </tr>
                    <tr>
                        <td>驱动方式</td>
                        <td>{{ currentModelSpecs.driveType }}</td>
                    </tr>
                    <tr>
                        <td>座位布局</td>
                        <td>{{ currentModelSpecs.seating }}</td>
                    </tr>
                    <tr>
                        <td>油箱容积</td>
                        <td>{{ currentModelSpecs.fuelTank }}</td>
                    </tr>
                </tbody>
            </table>
        </div>
        
        <div v-if="selected.model">
            <!-- 车身外观大类 -->
            <div class="main-category" :class="{ active: isConfigActive }">
                <div class="main-category-title">车身外观</div>
                
                <div class="config-section">
                    <div class="section-title">中网造型</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in grilleOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="grille" v-model="selected.grille" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
                
                <div class="config-section">
                    <div class="section-title">轮毂造型</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in wheelOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="wheel" v-model="selected.wheel" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
                
                <div class="config-section">
                    <div class="section-title">轮毂标</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in wheelLogoOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="wheelLogo" v-model="selected.wheelLogo" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
                
                <div class="config-section">
                    <div class="section-title">车身漆面</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in paintOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="paint" v-model="selected.paint" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                        <div v-if="selected.paint === 'custom'" class="custom-paint-input">
                            <input type="text" v-model="selected.customPaintValue" placeholder="请输入自定义漆面需求" class="custom-input" :disabled="!isConfigActive">
                        </div>
                    </div>
                </div>
                
                <div class="config-section">
                    <div class="section-title">车身标识</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in bodyBadgeOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="bodyBadge" v-model="selected.bodyBadge" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
            </div>
            
            <!-- 车内中舱大类 -->
            <div class="main-category" :class="{ active: isConfigActive }">
                <div class="main-category-title">车内中舱</div>
                
                <div class="config-section">
                    <div class="section-title">座椅状态选择</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in seatStatusOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="seatStatus" v-model="selected.seatStatus" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
                
                <div class="config-section">
                    <div class="section-title">后舱进出方式</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in rearAccessOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="rearAccess" v-model="selected.rearAccess" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
                
                <div class="config-section">
                    <div class="section-title">蛋壳背板形态</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in backPanelOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="backPanel" v-model="selected.backPanel" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
            </div>

            <!-- 车内后舱大类 -->
            <div class="main-category" :class="{ active: isConfigActive }">
                <div class="main-category-title">车内后舱</div>
                
                <div class="config-section">
                    <div class="section-title">多功能三人座椅</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in multifunctionalOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="multifunctional" v-model="selected.multifunctional" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
                
                <div class="config-section">
                    <div class="section-title">环抱舱三人座椅</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in surroundOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="surround" v-model="selected.surround" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
                
            </div>

            <!-- 专项附加 -->
            <div class="main-category" :class="{ active: isConfigActive }">
                <div class="main-category-title">专项附加</div>
                
                <div class="config-section">
                    <div class="section-title">中滑门电动推拉窗</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in electricSlidingOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="electricSliding" v-model="selected.electricSliding" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
                
                <div class="config-section">
                    <div class="section-title">后舱独立新风换气/双新风系统</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in dualAirOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="dualAir" v-model="selected.dualAir" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
                
                <div class="config-section">
                    <div class="section-title">乘客舱座椅扶手加热</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in armrestHeatingOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="armrestHeating" v-model="selected.armrestHeating" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>

                <div class="config-section">
                    <div class="section-title">模式感应香薰系统</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in aromatherapyOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="aromatherapy" v-model="selected.aromatherapy" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>

                <div class="config-section">
                    <div class="section-title">开门警视</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in doorWarningOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="doorWarning" v-model="selected.doorWarning" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>

                <div class="config-section">
                    <div class="section-title">车身环视</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in vehicleSurroundOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="vehicleSurround" v-model="selected.vehicleSurround" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
            </div>

            <!-- 情绪价值 -->
            <div class="main-category" :class="{ active: isConfigActive }">
                <div class="main-category-title">情绪价值</div>
                
                <div class="config-section">
                    <div class="section-title">特别定义的灯光、声音、图片和视频（场景1:欢迎贵客；场景2：庆祝生日；）</div>
                    <div class="option-group">
                        <label class="option-label" v-for="option in emotionalValueOptions" :key="option.value">
                            {{ option.label }}
                            <input type="radio" name="emotionalValue" v-model="selected.emotionalValue" :value="option.value" :disabled="!isConfigActive">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                </div>
                
            </div>
        </div>
        
        
        <!-- 自定义配置大类 -->
        <div class="main-category" :class="{ active: isConfigActive }">
            <div class="main-category-title">自定义配置</div>
            <div class="config-section">
                <div class="section-title">个性化需求</div>
                <div class="custom-config">
                    <div class="custom-item" v-for="(item, index) in customConfigs" :key="index">
                        <input type="text" class="custom-input" v-model="item.value" 
                               :placeholder="'请输入您的第 ' + (index + 1) + ' 项个性化需求'" :disabled="!isConfigActive">
                        <button class="remove-btn" @click="removeCustomConfig(index)" :disabled="!isConfigActive">删除</button>
                    </div>
                    <button class="add-btn" @click="addCustomConfig" :disabled="!isConfigActive">
                        <span style="margin-right: 5px;">+</span> 添加需求
                    </button>
                </div>
            </div>
        </div>
        
        <div class="summary">
            <div class="summary-title">您选择的配置</div>
            
            <div class="summary-item" v-if="selected.platform && selected.model">
                <strong>车型:</strong> {{ selectedPlatformName }} - {{ selectedModelName }}
            </div>
            <div class="summary-item no-selection" v-else>
                <strong>车型:</strong> 未选择
            </div>
            
            <div class="summary-category" v-if="isConfigActive">
                <div class="category-title">车身外观</div>
                
                <div class="summary-item">
                    <strong>中网造型:</strong> 
                    <span v-if="selected.grille">{{ getOptionLabel(grilleOptions, selected.grille) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
                <div class="summary-item">
                    <strong>轮毂造型:</strong> 
                    <span v-if="selected.wheel">{{ getOptionLabel(wheelOptions, selected.wheel) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
                <div class="summary-item">
                    <strong>轮毂标:</strong> 
                    <span v-if="selected.wheelLogo">{{ getOptionLabel(wheelLogoOptions, selected.wheelLogo) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
                <div class="summary-item">
                    <strong>车身漆面:</strong> 
                    <span v-if="selected.paint === 'custom'">{{ selected.customPaintValue || '(未填写)' }}</span>
                    <span v-else-if="selected.paint">{{ getOptionLabel(paintOptions, selected.paint) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
                <div class="summary-item">
                    <strong>车身标识:</strong> 
                    <span v-if="selected.bodyBadge">{{ getOptionLabel(bodyBadgeOptions, selected.bodyBadge) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
            </div>
            
            <div class="summary-category" v-if="isConfigActive">
                <div class="category-title">车内中舱</div>
                
                <div class="summary-item">
                    <strong>座椅状态选择:</strong> 
                    <span v-if="selected.seatStatus">{{ getOptionLabel(seatStatusOptions, selected.seatStatus) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
                <div class="summary-item">
                    <strong>后舱进出方式:</strong> 
                    <span v-if="selected.rearAccess">{{ getOptionLabel(rearAccessOptions, selected.rearAccess) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
                <div class="summary-item">
                    <strong>蛋壳背板形态:</strong> 
                    <span v-if="selected.backPanel">{{ getOptionLabel(backPanelOptions, selected.backPanel) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
            </div>
            <div class="summary-category" v-if="isConfigActive">
                <div class="category-title">车内后舱</div>
                
                <div class="summary-item">
                    <strong>多功能三人座椅:</strong> 
                    <span v-if="selected.multifunctional">{{ getOptionLabel(multifunctionalOptions, selected.multifunctional) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
                <div class="summary-item">
                    <strong>环抱舱三人座椅:</strong> 
                    <span v-if="selected.surround">{{ getOptionLabel(surroundOptions, selected.surround) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
            </div>

            <div class="summary-category" v-if="isConfigActive">
                <div class="category-title">专项附件</div>
                
                <div class="summary-item">
                    <strong>中滑门电动推拉窗:</strong> 
                    <span v-if="selected.electricSliding">{{ getOptionLabel(electricSlidingOptions, selected.electricSliding) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
                <div class="summary-item">
                    <strong>后舱独立新风换气:</strong> 
                    <span v-if="selected.dualAir">{{ getOptionLabel(dualAirOptions, selected.dualAir) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
                <div class="summary-item">
                    <strong>乘客舱座椅扶手加热:</strong> 
                    <span v-if="selected.armrestHeating">{{ getOptionLabel(armrestHeatingOptions, selected.armrestHeating) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>

                <div class="summary-item">
                    <strong>模式感应香薰系统:</strong> 
                    <span v-if="selected.aromatherapy">{{ getOptionLabel(aromatherapyOptions, selected.aromatherapy) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>

                <div class="summary-item">
                    <strong>开门警视:</strong> 
                    <span v-if="selected.doorWarning">{{ getOptionLabel(doorWarningOptions, selected.doorWarning) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>

                <div class="summary-item">
                    <strong>车身环视:</strong> 
                    <span v-if="selected.vehicleSurround">{{ getOptionLabel(vehicleSurroundOptions, selected.vehicleSurround) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
            </div>

            <div class="summary-category" v-if="isConfigActive">
                <div class="category-title">情绪价值</div>
                
                <div class="summary-item">
                    <strong>特别定义的灯光、声音、图片和视频（场景1:欢迎贵客；场景2：庆祝生日；）:</strong> 
                    <span v-if="selected.emotionalValue">{{ getOptionLabel(emotionalValueOptions, selected.emotionalValue) }}</span>
                    <span v-else class="no-selection">未选择</span>
                </div>
                
            </div>
            
            <div class="summary-category" v-if="isConfigActive && customConfigs.length > 0">
                <div class="category-title">自定义配置</div>
                <div class="summary-item" v-for="(item, index) in customConfigs" :key="index">
                    <div class="custom-summary-item">
                        <span>{{ index + 1 }}. {{ item.value || '(未填写)' }}</span>
                        <span class="custom-remove" @click="removeCustomConfig(index)">删除</span>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 添加下单按钮 -->
        <div class="order-button-container">
            <button class="order-button" @click="handleOrder" :disabled="!isConfigActive">
                确认无误后，请下单
            </button>
        </div>
    </div>

    <script>
        checkAuthentication(2)
        new Vue({
            el: '#app',
            data: {
                currentDealer: JSON.parse(localStorage.getItem('currentDealer')) || {},
                dealerMenuList: JSON.parse(localStorage.getItem('dealerMenuList')) || [],
                selected: {
                    platform: '',
                    model: '',
                    grille: '',
                    wheel: '',
                    wheelLogo: '',
                    paint: '',
                    customPaintValue: '',
                    bodyBadge: '',
                    seatStatus: '',
                    rearAccess: '',
                    midCabin: '',
                    backPanel: '',
                    multifunctional: '',
                    surround: '',
                    electricSliding: '',
                    dualAir: '',
                    armrestHeating: '',
                    aromatherapy: '',
                    doorWarning: '',
                    vehicleSurround: '',
                    emotionalValue: '',
                },
                customConfigs: [],
                platforms: [
                    { id: 'P009', name: 'V300L' },
                    { id: 'P010', name: '威霆' },
                    { id: 'P003', name: '猛士' }
                ],
                models: [
                    { id: 'P009M002', platformId: 'P009', name: '进口湾流定制' },
                    { id: 'P009M003', platformId: 'P009', name: '天舟' },
                    { id: 'P009M004', platformId: 'P009', name: '天行' },
                    { id: 'P010M001', platformId: 'P010', name: '威霆' },
                    { id: 'P003M001', platformId: 'P003', name: '猛士M800' },
                    { id: 'P003M002', platformId: 'P003', name: '猛士M900' },
                    { id: 'P003M003', platformId: 'P003', name: '猛士M600' }
                ],
                modelSpecs: {
                    P009M002: {
                        dimensions: '5230×1900×1480mm',
                        wheelbase: '3100mm',
                        engine: '3.0T V6',
                        displacement: '2995mL',
                        maxPower: '340马力/5500rpm',
                        maxTorque: '450牛·米/1500-4500rpm',
                        transmission: '8速手自一体',
                        driveType: '前置后驱',
                        seating: '2+2+2',
                        fuelTank: '70L'
                    },
                    m2: {
                        dimensions: '5230×1900×1480mm',
                        wheelbase: '3100mm',
                        engine: '4.0T V8',
                        displacement: '3996mL',
                        maxPower: '480马力/5500rpm',
                        maxTorque: '650牛·米/1500-4500rpm',
                        transmission: '8速手自一体',
                        driveType: '前置四驱',
                        seating: '2+2',
                        fuelTank: '80L'
                    },
                    m3: {
                        dimensions: '4950×1900×1420mm',
                        wheelbase: '2950mm',
                        engine: '3.0T V6 高性能',
                        displacement: '2995mL',
                        maxPower: '450马力/6500rpm',
                        maxTorque: '550牛·米/2000-5000rpm',
                        transmission: '10速手自一体',
                        driveType: '前置后驱',
                        seating: '2+2',
                        fuelTank: '65L'
                    },
                    m4: {
                        dimensions: '4950×1900×1380mm',
                        wheelbase: '2950mm',
                        engine: '4.0T V8 高性能',
                        displacement: '3996mL',
                        maxPower: '550马力/6500rpm',
                        maxTorque: '700牛·米/2000-5000rpm',
                        transmission: '10速手自一体',
                        driveType: '前置四驱',
                        seating: '2',
                        fuelTank: '70L'
                    },
                    m5: {
                        dimensions: '5100×1900×1450mm',
                        wheelbase: '3050mm',
                        engine: '双电机四驱',
                        displacement: '电动',
                        maxPower: '500马力',
                        maxTorque: '800牛·米',
                        transmission: '单速变速箱',
                        driveType: '电动四驱',
                        seating: '2+2+2',
                        fuelTank: '电池容量 100kWh'
                    },
                    m6: {
                        dimensions: '5100×1900×1430mm',
                        wheelbase: '3050mm',
                        engine: '三电机四驱',
                        displacement: '电动',
                        maxPower: '700马力',
                        maxTorque: '1000牛·米',
                        transmission: '单速变速箱',
                        driveType: '电动四驱',
                        seating: '2+2',
                        fuelTank: '电池容量 120kWh'
                    }
                },
                grilleOptions: [
                    { value: 'feather', label: '羽翼格栅' },
                    { value: 'jet', label: '射流格栅' },
                    { value: 'lotus', label: '莲花生辉' }
                ],
                wheelOptions: [
                    { value: 'multi', label: '多福纵横' },
                    { value: 'turbine', label: '涡轮驰骋' },
                    { value: 'fireworks', label: '礼花绽放' }
                ],
                wheelLogoOptions: [
                    { value: 'fixed', label: '固定式' },
                    { value: 'floating', label: '悬浮式' },
                    { value: 'black', label: '曜石黑' }
                ],
                paintOptions: [
                    { value: 'purple', label: '帝王紫' },
                    { value: 'black', label: '曜石黑' },
                    { value: 'custom', label: '自定义（贴膜上牌，后续变更）' }
                ],
                bodyBadgeOptions: [
                    { value: 'silver', label: '银色' },
                    { value: 'gold', label: '金色' }
                ],
                seatStatusOptions: [
                    { value: 'base', label: '湾流航空座椅' },
                    { value: 'rotate', label: '湾流航空座椅+旋转' },
                    { value: 'zero', label: '湾流航空座椅+零重力' }
                ],
                rearAccessOptions: [
                    { value: 'center', label: '中央通道进出' },
                    { value: 'right', label: '右侧座椅后部进出：配中央扶手箱' }
                ],
                backPanelOptions: [
                    { value: 'backboard', label: '附属座椅背板' },
                    { value: 'fixed', label: '独立固定背板' }
                ],
                multifunctionalOptions: [
                    { value: 'backboard', label: '手动收藏储物箱' },
                    { value: 'fixed', label: '手动快捷升降桌板' },
                    { value: 'fixed1', label: '电动智能升降桌板' }
                ],
                surroundOptions: [
                    { value: 'backboard', label: '手动收藏储物箱' },
                    { value: 'fixed', label: '手动快捷升降桌板' },
                    { value: 'fixed1', label: '电动智能升降桌板' }
                ],
                electricSlidingOptions: [
                    { value: 'no', label: '无' },
                    { value: 'yes', label: '有' }
                ],
                dualAirOptions: [
                    { value: 'no', label: '无' },
                    { value: 'yes', label: '有' }
                ],
                armrestHeatingOptions: [
                    { value: 'no', label: '无' },
                    { value: 'yes', label: '有' }
                ],
                aromatherapyOptions: [
                    { value: 'no', label: '无' },
                    { value: 'yes', label: '有' }
                ],
                doorWarningOptions: [
                    { value: 'no', label: '无' },
                    { value: 'yes', label: '有' }
                ],
                vehicleSurroundOptions: [
                    { value: 'no', label: '无' },
                    { value: 'yes', label: '有' }
                ],
                emotionalValueOptions: [
                    { value: 'no', label: '无' },
                    { value: 'yes', label: '有' }
                ]
            },
            computed: {
                filteredModels() {
                    if (!this.selected.platform) return [];
                    return this.models.filter(model => model.platformId === this.selected.platform);
                },
                isConfigActive() {
                    return !!this.selected.model;
                },
                selectedPlatformName() {
                    if (!this.selected.platform) return '';
                    const platform = this.platforms.find(p => p.id === this.selected.platform);
                    return platform ? platform.name : '';
                },
                selectedModelName() {
                    if (!this.selected.model) return '';
                    const model = this.models.find(m => m.id === this.selected.model);
                    return model ? model.name : '';
                },
                currentModelSpecs() {
                    if (!this.selected.model)return {
                currentUser: JSON.parse(localStorage.getItem('currentUser')) || {},
                userMenuList: JSON.parse(localStorage.getItem('userMenuList')) || [],};
                    return this.modelSpecs[this.selected.model] || {};
                }
            },
            methods: {
                exit,
                getOptionLabel(options, value) {
                    const option = options.find(opt => opt.value === value);
                    return option ? option.label : '';
                },
                addCustomConfig() {
                    this.customConfigs.push({ value: '' });
                },
                removeCustomConfig(index) {
                    this.customConfigs.splice(index, 1);
                },
                onPlatformChange() {
                    this.selected.model = '';
                },
                onModelChange() {
                    // 可以在这里根据选择的车型加载不同的配置选项
                    console.log('车型已选择:', this.selected.model);
                },
                handleOrder() {
                    // 这里添加下单逻辑
                    console.log('提交订单:', this.selected);
                    alert('订单提交成功！');
                }
            }
        });
    </script>
</body>
</html>